ComponentOne Basic Library for UWP
Step 1 of 3: Creating an Application with a C1DropDown Control
UWP Edition Basic Library > DropDown for UWP > C1DropDown Quick Start > Step 1 of 3: Creating an Application with a C1DropDown Control

In this step, you'll create a UWP application in Visual Studio using DropDown for UWP.

  1. In Visual Studio 2013 Select File | New | Project.
  2. In the New Project dialog box, select Templates | Visual C# | Windows | Universal. From the templates list, select Blank App (Universal Windows). Enter a Name and click OK to create your project.
  3. Open MainPage.xaml if it isn't already open. 
  4. Edit your opening <Page> tag to add the following namespace:
Markup
Copy Code
xmlns:Xaml="using:C1.Xaml"
  1. Locate the <Grid> </Grid> tags on your page and insert the following to define your Grid rows:
Markup
Copy Code
<Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
  1. Directly below the row definitions, add a CheckBox using the following markup:
Markup
Copy Code
<CheckBox Content="AutoClose - determines if C1DropDown will automatically close when focus is lost." IsChecked="{Binding ElementName=c1DropDown1, Path=AutoClose, Mode=TwoWay}" Margin="10"/>
  1. Use the following markup to add a C1DropDownButton control:
Markup
Copy Code
<Xaml:C1DropDownButton Grid.Row="1" Background="White" x:Name="c1DropDown1" Padding="2" Width="150" HorizontalAlignment="Center" VerticalAlignment="Center" > </Xaml:C1DropDownButton>
  1.  Next, we'll add some Header content to customize the C1DropDownButton.Header:
Markup
Copy Code
<Xaml:C1DropDownButton.Header>
  <Border x:Name="dropDownBorder" Background="White" />
</Xaml:C1DropDownButton.Header>

What You've Accomplished

In this step, you created a new Visual Studio Universal Windows application, added a CheckBox control, and added and began customizing a C1DropDown control.

See Also